package com.ruoyi.syf.handler.escalation.strategy;

import com.ruoyi.syf.common.constant.EscalationDataType;
import com.ruoyi.syf.handler.escalation.EscalationStrategy;
import com.ruoyi.syf.mapper.RiskCheckDangerMapper;
import com.ruoyi.syf.service.EscalationService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * 隐患信息上报
 */
@Service
public class DangerEscalationStrategy implements EscalationStrategy {

    @Resource
    private EscalationService escalationService;

    @Resource
    private RiskCheckDangerMapper dangerMapper;

    @Override
    public boolean escalation() {
        List<Map<String, Object>> data = dangerMapper.escalation();
        return escalationService.httpEscalation(data, getEscalationType());
    }

    @Override
    public String getEscalationType() {
        return EscalationDataType.DANGER.getCode();
    }

}
